package com.iocup.keybastion.core.profile;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * The contract that all user profiles must respect.
 *
 * @author Jerome Leleu
 * @since 4.0.0
 */
public interface UserProfile extends Serializable {

    <T> T getId();

    <T> UserProfile setId(T id);

    String getLoginName();

    UserProfile setLoginName(String loginName);

    String getUsername();

    UserProfile setUsername(String username);

   <T> T getAttribute(String name);

    Map<String, Object> getAttributes();

    boolean containsAttribute(String name);

    UserProfile setAttribute(Map<String, Object> data);

    UserProfile addAttribute(String key, Object value);

    UserProfile addRole(String role);

    UserProfile addRoles(Collection<String> roles);

    UserProfile setRoles(Collection<String> roles);

    Set<String> getRoles();

    UserProfile addPermission(String permission);

    UserProfile addPermissions(Collection<String> permissions);


    UserProfile setPermissions(Collection<String> permissions);

    Set<String> getPermissions();

    boolean isRemembered();

    UserProfile setRemembered(boolean rme);


    String getDevice();

    UserProfile setDevice(String device);
}
